package com.xiashitech.agent.instrumentation.undertow.common;

import io.opentelemetry.javaagent.shaded.io.opentelemetry.context.propagation.TextMapSetter;
import org.jetbrains.annotations.Nullable;

import javax.servlet.http.HttpServletResponse;

public enum UndertowResponseSetter implements TextMapSetter<HttpServletResponse> {
    INSTANCE;

    @Override
    public void set(@Nullable HttpServletResponse carrier, String key, String value) {
        if (carrier == null) {
            return;
        }
        carrier.setHeader(key, value);
    }
}
